/*
 * Project: Sudoku Explainer
 * Copyright (C) 2006-2007 Nicolas Juillerat
 * 
 * Project: Sudoku Hint Engine for Android
 * Copyright (C) 2010-2013 Emanuel Moecklin
 * 
 * Available under the terms of the Lesser General Public License (LGPL)
 */
package com.onegravity.sudoku.solver.rules;

import android.net.Uri;

import com.onegravity.sudoku.solver.HintResource;
import com.onegravity.sudoku.solver.HintType;
import com.onegravity.sudoku.solver.core.DirectHint;
import com.onegravity.sudoku.solver.core.Rule;
import com.onegravity.sudoku.solver.data.Cell;
import com.onegravity.sudoku.solver.util.HtmlLoader;

/**
 * Brute Force hint
 */
public class BruteForceHint extends DirectHint implements Rule {
	
	private static final long serialVersionUID = -5804544703192893197L;

	public BruteForceHint(Cell cell, int value) {
        super(null, cell, value, null, null);
    }

    @Override
    public double getDifficulty() {
        return 36.0;	// has to be high to increase the game time accordingly
    }

    @Override
    public String getName() {
    	return HintResource.BRUTE_FORCE.getName();
    }

    @Override
    public Uri getLink() {
    	return HintResource.BRUTE_FORCE.getUrl();
	}

    @Override
    public Cell getCell(HintType type) {
        return (type!=HintType.SMALL_CLUE) ? super.getCell(type) : null;
    }

    @Override
    public String getHintHtml(HintType type) {
    	HintResource res = HintResource.BRUTE_FORCE;
        String result = HtmlLoader.loadHtml(res.hint(type));
        return HtmlLoader.format(result, super.getCell(type).toString(), super.getValue());
    }

    @Override
    public String toString() {
    	return HintResource.BRUTE_FORCE.toString(0);
    }

    @Override
    public int getNrOfSteps() {
    	return 2;
    }

}